import { MockMethod } from 'vite-plugin-mock';
export default [
    {
        url: '/api/user/login',
        method: 'post',
        timeout: 2000,
        response:({ body }:{body:any}) => {
            console.log(body)
            return {
                "data":{
                    token: '1234-5678-90ab-cdef',//不是sessionid就是token
                    type:4,//登录人身份类型
                },
                "success":true,
                "code":'0',
                "msg":'ok',
            }
        }
    },
    {
        url: '/api/user/hideLogin',
        method: 'post',
        timeout: 2000,
        response:({ body }:{body:any}) => {
            console.log(body)
            return {
                "data":{
                    token: '1234-5678-90ab-cdef',//不是sessionid就是token
                    type:4,//登录人身份类型
                },
                "success":true,
                "code":'0',
                "msg":'ok',
            }
        }
    },
    {
        url: '/api/user/logout',
        method: 'post',
        timeout: 2000,
        response:({ body }:{body:any}) => {
            console.log(body)
            return {
                "success":true,
                "code":'0',
                "msg":'ok',
            }
        }
    },
    {
        url: '/api/user/getInfo',
        method: 'post',
        timeout: 3000, //故意设置延迟时间，更能接近真实场景，观察载入前及载入后的状态
        response:({ body }:{body:any}) => {
            console.log(body)
            return {
                "data":{
                    staffId:'openkf1',
                    staffName:'黄远大',
                    provinceCode:'9A',
                    staffType: 4,//用户身份类型
                    //avatar: '/img/avatar/avatar.png',
                    phoneNum: '18655555555',
                },
                "success":true,
                "code":'0',
                "msg":'ok',
            }
        }
    },
    {
        url: '/api/user/noop', //用来检查是否在服务端已登录、token是否已过期 只要服务端返回状态401即为未登录或登录失效
        method: 'post',
        timeout: 100,
        response:({ body }:{body:any}) => {
            console.log(body)
            return {
                "success":true,
                "code":'0',
                "msg":'ok',
            }
        }
    },
] as MockMethod[]